<%@ include file="/WEB-INF/jsp/header.jsp" %>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 

<h1>${gallery.name}</h1>
<h3>od uživatele: ${gallery.owner.userName}</h3>

<c:choose>
  	<c:when test="${empty photos}">
  		<p>V této galerii nejsou žádné fotografie</p> 
  	</c:when>
  	<c:otherwise>
  		<c:forEach var="photo" items="${photos}">
			<div class="snapshot">
				<a href="<spring:url value="/gallery/show/${gallery.id}/${photo.id}" htmlEscape="true" />"><img src="${pageContext.request.contextPath}/uploaded/${gallery.owner.userName}/${gallery.rootFolder}/thumbnails/${photo.fileName}" height="120" /></a>
				<br>
				<a href="<spring:url value="/gallery/show/${gallery.id}/${photo.id}" htmlEscape="true" />">${fn:length(photo.comments)} komentářů</a>
			</div>
		</c:forEach>
  	</c:otherwise>
</c:choose>



<%@ include file="/WEB-INF/jsp/footer.jsp" %>